﻿using Dimebrain.TweetSharp.Core.Web;

namespace Dimebrain.TweetSharp.Fluent
{
    partial class Extensions
    {
        public static string AsUrl(this ITwitterSavedSearches instance)
        {
            return instance.Root.AsUrl();
        }

        public static ITwitterSavedSearches AuthenticateAs(this ITwitterSavedSearches instance,
                                                    string username,
                                                    string password)
        {
            instance.Root.AuthenticateAs(username, password);
            return instance;
        }

        public static ITwitterSavedSearches CallbackTo(this ITwitterSavedSearches instance, WebCallback callback)
        {
            instance.Root.Callback = callback;
            return instance;
        }

#if !SILVERLIGHT
        public static string Request(this ITwitterSavedSearches instance)
        {
            return instance.Root.Request();
        }
#endif

        public static void RequestAsync(this ITwitterSavedSearches instance)
        {
            instance.Root.RequestAsync();
        }
    }
}
